package org.jiopi.ibean.show.helloworld;

import java.util.Map;
import java.util.concurrent.TimeUnit;

import org.jiopi.framework.CentralConsole;
import org.jiopi.framework.FrameworkInitializer;

/**
 * 
 * show how to use a module of implementation of a Java Interface
 *
 */
public class JavaInterfaceShow {

	/**
	 * @param args
	 * @throws Exception 
	 */
	public static void main(String[] args) throws Exception {
		FrameworkInitializer.initialize();
		
		//Map<Object,Object> referenceMap = CentralConsole.accessControlPanel("agrael.collection.referencemap", null, Map.class.getName(), null);
		Map<Object,Object> referenceMap = CentralConsole.accessControlPanel("http://www.jiopi.org/ibean/resourcepools/modules/agrael.collection.referencemap/agrael.collection.referencemap.xml", null, Map.class.getName(), null);
		Object key = new Object();   
        Object value = new Object();   
        referenceMap.put(key, value);   
        System.out.println(referenceMap.isEmpty()); 
        
        key = null;
        System.gc();   
        TimeUnit.SECONDS.sleep(5);   
        System.out.println(referenceMap.isEmpty()); 
	}
}
